public class Fan {
	/*
	 * fan's status*/
	boolean on;
	int id;
	/*
	 * fan's color
	 */
	String color;
	/*
	 * fan's radius
	 */
	double radius;

	/*
	 * fan's speed
	 */
	int speed;

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Fan other = (Fan) obj;
		if (color == null) {
			if (other.color != null)
				return false;
		} else if (!color.equals(other.color))
			return false;
		if (Double.doubleToLongBits(radius) != Double.doubleToLongBits(other.radius))
			return false;
		if (speed != other.speed)
			return false;
		return true;
	}

	public String getColor() {
		return color;
	}

	public int getId() {
		return id;
	}
	public double getRadius() {
		return radius;
	}

	public int getSpeed() {
		return speed;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((color == null) ? 0 : color.hashCode());
		long temp;
		temp = Double.doubleToLongBits(radius);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + speed;
		return result;
	}

	public boolean isOn() {
		return on;
	}

	public void setColor(String color) {
		this.color = color;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setOn(boolean on) {
		this.on = on;
	}

	public void setRadius(double radius) {
		this.radius = radius;
	}

	public void setSpeed(int speed) {
		this.speed = speed;
	}

	@Override
	public String toString() {
		return "Fan [on=" + on + ", id=" + id + ", color=" + color + ", radius=" + radius + ", speed=" + speed + "]";
	}
}
